from Process_info import getProcessInfo
from Network_info import getNetstats,getNicinfo
from CPU_info import getCPUstate
from Login_Info import getLoginInfo
from Mem_Info import getMemorystate
from Disk_partitions_Info import getDiskstate
from System_time_Info import getSystemrelativetime
#统一来控制刷新时间,还有一个更重要的作用是，在执行屏幕刷新之前准备好所有的数据，避免刷新时造成闪屏的效果
BFH = r'%'
#统一来控制刷新时间,还有一个更重要的作用是，在执行屏幕刷新之前准备好所有的数据，避免刷新时造成闪屏的效果
def poll(process_nums=10):
    """Retrieve raw stats within an interval window."""
    # get cpu state
    cpu_state = getCPUstate()
    # get memory
    memory_state = getMemorystate()
    # get system relative time
    system_time = getSystemrelativetime()
    # get user information
    user_info = getLoginInfo()
    # get disk information
    disk_info = getDiskstate()
    # get process information
    processinfo = getProcessInfo(process_nums)
    # get network information
    netstats = getNetstats()
    nicinfo = getNicinfo()
    return (cpu_state, memory_state,system_time,user_info,disk_info,processinfo,netstats,nicinfo)